<?php

require_once('resources/class/private/webos.php');

$webos = new webosClass();

if (JAdmin_core::check_login()) {

	$userAppData = $webos -> get_user_app($USER['uid']);

} else {
	
	$userAppData = $webos -> get_default_app();

}

while ($dr = mysql_fetch_array($userAppData)) {
	
	$userApp = '<app id="' . $dr['webosAppListID'] . '" name="' . $dr['appName'] . '" ico="' . $dr['appIco'] . '" config="' . APPLICATION_CONFIG . '&amp;appid=' . $dr['webosAppListID'] . '" verify="' .$dr['appVerify'] . '" update="' . $dr['appUpdate'] . '" explain="' . $dr['appExplain'] . '"></app>';
	
	$screenArray[$dr['uaScreen']] .= $userApp;
	
}

header("Content-type: text/xml");

?>
<application>
	
	<shortcut>
		<app id="jBlog" name="我的博客" ico="application/MyBlog/big.png" config="application/MyBlog/config.xml" verify="1"></app>
		<app id="DouBanFM" name="豆瓣FM" ico="application/doubanFM/big.png" config="application/doubanFM/config.xml" verify="1"></app>
	</shortcut>

	<screen>
		<applist>	
			<?php echo $screenArray[0];?>
		</applist>
	</screen>

	<screen>
		<applist>	
			<?php echo $screenArray[1];?>
		</applist>
	</screen>

	<screen>
		<applist>	
			<?php echo $screenArray[2];?>
		</applist>
	</screen>

	<screen>
		<applist>	
			<?php echo $screenArray[3];?>
		</applist>
	</screen>

	<screen>
		<applist>	
			<?php echo $screenArray[4];?>
		</applist>
	</screen>

</application>